IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[Pro_HorizontalSplit]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
 DROP PROCEDURE [dbo].Pro_HorizontalSplit
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE Pro_HorizontalSplit
AS
SET NOCOUNT ON

BEGIN
 
 INSERT INTO dbo.InOutstocktable SELECT * FROM dbo.InOutstocktable WHERE SortID IN (SELECT * FROM #sortID)
          
 
END

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO 